<template>
	<view class="parse-main-box">
		<uni-loding :loading='loading'></uni-loding>
		<!-- <richTextDom :info="info" /> -->
		<u-parse :content="info" style="font-size: 30rpx;color: #666;" />
	</view>
</template>

<script>
	import richTextUtil from '@/utils/richTextUtil.js';
	import uParse from '@/components/u-parse/u-parse.vue';
	export default {
		components: {
			uParse
		},
		data() {
			return {
				info: '',
				loading: true
			}
		},
		onLoad(params) {
			let title = '';
			switch (params.url) {
				case 'about':
					title = '关于我们';
					break;
				case 'secret':
					title = '隐私声明';
					break;
				case 'service':
					title = '秦创原（泾河）科技人才·企业服务中心';
					break;
			}
			uni.setNavigationBarTitle({
				title: title
			})
			this.init(params.url);
		},
		methods: {
			init(url) {
				let that = this;
				if (url == 'service') {
					that.$func.request('/power/index/service_center').then(res => {
						that.info = richTextUtil.formatRichText(res.data.list.service);
						that.loading = false
					})
				} else {
					that.$func.request('/system/config/secret').then(res => {
						that.info = richTextUtil.formatRichText(res.data.data.content);
						that.loading = false
					})
				}


			},
		}
	}
</script>

<style scoped>
	.parse-main-box {
		height: 100vh;
		padding: 30rpx;
		overflow: auto;
		box-sizing: border-box;
	}
</style>